package com.woniu.service.imple;

import com.woniu.adapter.CompanyVipApplicationAdapter;
import com.woniu.outlet.po.CompanyVipApplication;
import com.woniu.service.ICompanyVipApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CompanyVipApplicationService implements ICompanyVipApplicationService {

    @Autowired
    private CompanyVipApplicationAdapter companyVipApplicationAdapter;

    //客户经理提出将某个客户申请为VIP，然后需要营销经理来审批、审批通过了，就给客户发一条消息！！
    @Override
    public int applicationvip(CompanyVipApplication companyVipApplication) {
        int applicationvip = companyVipApplicationAdapter.applicationvip(companyVipApplication);
        return applicationvip;
    }


    //营销经理可以查看所有没有处理的申请
    @Override
    public List<CompanyVipApplication> findAllCompanyVipApplication() {
        List<CompanyVipApplication> allCompanyVipApplication = companyVipApplicationAdapter.findAllCompanyVipApplication();
        return allCompanyVipApplication;
    }

    //营销经理拒绝此客户成为vip客户
    @Override
    public int confusevipapplication(Integer companyvipapplicationId) {
        int confusevipapplication = companyVipApplicationAdapter.confusevipapplication(companyvipapplicationId);

        return confusevipapplication;
    }

    //营销经理同意此客户成为vip客户
    @Override
    public int agreevipapplication(Integer companyid, Integer companyvipapplicationId) {
        int agreevipapplication = companyVipApplicationAdapter.agreevipapplication(companyid, companyvipapplicationId);
        return agreevipapplication;
    }
}
